*** panel tests 
*1. modified wald test
xtreg f.dge_p  c.odagdp c.v2x_corr v2x_api remit_gdp fdi_gdp lngdppc  gdpgrowth  trade urban lnpop  enrollment unemploy if recipient_ever==1, fe
xttest3 

*2. serial correlation test
xtserial dge_p  odagdp v2x_corr v2x_api remit_gdp fdi_gdp lngdppc  gdpgrowth  trade urban lnpop  enrollment unemploy if recipient_ever==1 ///The null is no serial correlation

*3. cross sectional correlation test
xtreg f.dge_p  c.odagdp c.v2x_corr , fe
xtcsd, pesaran abs



**main results**
**Table 1  
global control " v2x_api lngdppc gdpgrowth trade fdi_gdp remit_gdp urban lnpop enrollment unemploy"

xtscc f.dge_p  c.odagdp c.v2x_corr $control  if recipient_ever==1  , fe lag(1) 
 outreg using table_1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtscc f.dge_p  c.odagdp##c.v2x_corr $control if recipient_ever==1  , fe lag(1)
 outreg using table_1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 
xtscc f.dge_p  c.odagdp c.v2x_corr  $control  i.year if recipient_ever==1  , fe lag(1)
 outreg using table_1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 
xtscc f.dge_p  c.odagdp##c.v2x_corr  $control  i.year if recipient_ever==1  , fe lag(1)
 outreg using table_1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

	*Figure 2
	margins, dydx(odagdp) at(v2x_corr=(0 (.1) 1))
	marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Corruption Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_corr if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Corruption Level") lwidth(vthin) fcolor(none) lcolor(black) )
		 
	graph save figure_2
	 
**Table 2 
xtscc f.dge_p  c.odagdp##c.v2x_corr $control  i.year if recipient_ever==1  , fe lag(1)
sum  v2x_corr if e(sample), detail 
margins, dydx(odagdp) at(v2x_corr=(0.426)) // 25% percentile
margins, dydx(odagdp) at(v2x_corr=(0.827)) // 75% percentile
margins, dydx(odagdp) at(v2x_corr=(0.597)) // mean
margins, dydx(odagdp) at(v2x_corr=(0.847)) // mean+1sd
margins, dydx(odagdp) at(v2x_corr=(0.347)) // mean-1sd	 

** Table 3  
xtabond2 dge_p L.dge_p c.odagdp c.v2x_corr $control  i.ccode i.year if recipient_ever ==1 , gmm (l.(dge_p c.odagdp c.v2x_corr $control ), lag(1 3))    twostep   noconstant 
 outreg using table_3.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtabond2 dge_p L.dge_p c.odagdp##c.v2x_corr $control  i.ccode i.year if recipient_ever==1 , gmm (l.(dge_p c.odagdp c.v2x_corr $control ), lag(1 3))    twostep   noconstant
 outreg using table_3.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

	*Figure 3  
	margins, dydx(odagdp) at(v2x_corr=(0 (.1) 1))
	marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Corruption Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_corr if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Corruption Level") lwidth(vthin) fcolor(none) lcolor(black) )
		
	graph save figure_3

	 
	 
**Appendix Tables**

**Table A1 

sum dge_p  c.odagdp c.v2x_corr v2x_api   lngdppc  gdpgrowth  trade   fdi_gdp remit_gdp urban lnpop  enrollment unemploy if e(sample)==1
	 

**Table A2 
xtreg f.dge_p  c.odagdp c.v2x_corr $control  i.year if recipient_ever==1
 outreg using table_a2.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtreg f.dge_p  c.odagdp##c.v2x_corr $control  i.year if recipient_ever==1
 outreg using table_a2.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

	*Figure A1
	margins, dydx(odagdp) at(v2x_corr=(0 (.1) 1))
	marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Corruption Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_corr if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Corruption Level") lwidth(vthin) fcolor(none) lcolor(black) )
		 
	graph save figure_a1

**Table A3 
xtscc f.dge_p  c.odagdp c.v2x_corr v2x_api   lngdppc  gdpgrowth  trade   fdi_gdp remit_gdp urban lnpop  enrollment unemploy i.year if recipient_ever==1, fe lag(1)   
 outreg using table_a3.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtscc f.dge_p  c.odagdp##c.v2x_api c.v2x_corr    lngdppc  gdpgrowth  trade   fdi_gdp remit_gdp urban lnpop  enrollment unemploy i.year if recipient_ever==1, fe lag(1)   
 outreg using table_a3.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge  

	*Figure A2
	margins, dydx(odagdp) at(v2x_api=(0 (.1) 1))
	marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Democracy Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_api if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Democracy Level") lwidth(vthin) fcolor(none) lcolor(black) )
		 
 	graph save figure_a2


** Table A4 
xtscc f.mimic_p c.odagdp c.v2x_corr $control   i.year if recipient_ever==1  , fe lag(1)
 outreg using table_a4.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtscc f.mimic_p c.odagdp##c.v2x_corr $control  i.year   if recipient_ever==1  , fe lag(1)
 outreg using table_a4.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

		
** Table A5 GMM
xtabond2 mimic_p L.mimic_p c.odagdp c.v2x_corr $control  i.ccode i.year if recipient_ever ==1 , gmm (l.(mimic_p c.odagdp c.v2x_corr $control ), lag(3 6))    twostep   noconstant
 outreg using table_a5.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtabond2 mimic_p L.mimic_p c.odagdp##c.v2x_corr $control  i.ccode i.year if recipient_ever ==1 , gmm (l.(mimic_p c.odagdp c.v2x_corr $control ), lag(3 6))    twostep   noconstant
 outreg using table_a5.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

	*Figure A3
	margins, dydx(odagdp) at(v2x_corr=(0 (.1) 1))
	marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Corruption Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_corr if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Corruption Level") lwidth(vthin) fcolor(none) lcolor(black) )		

 	graph save figure_a3


*Table A6 
xtscc f.dge_p  c.nat_gdp c.v2x_corr $control   if recipient_ever2==1  , fe lag(1)
 outreg using table_a6.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtscc f.dge_p  c.nat_gdp##c.v2x_corr $control  if recipient_ever2==1  , fe lag(1)
 outreg using table_a6.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 


*Table A7 
xtabond2 dge_p L.dge_p c.nat_gdp c.v2x_corr $control  i.ccode i.year if recipient_ever2 ==1 , gmm (l.(dge_p c.nat_gdp c.v2x_corr$control ), lag(1 3))    twostep   noconstant 
 outreg using table_a7.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtabond2 dge_p L.dge_p c.nat_gdp##c.v2x_corr $control  i.ccode i.year if recipient_ever2==1 , gmm (l.(dge_p c.nat_gdp c.v2x_corr $control ), lag(1 3))    twostep   noconstant  
 outreg using table_a7.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

	*Figure A4	 
	margins, dydx(nat_gdp) at(v2x_corr=(0 (.1) 1))
		marginsplot,yline(0, lcolor(black)) ytitle("The Effect of ODA on Informal Economy") legend(off) ///
		 title("Marginal Effect of ODA on Informal Economy by Corruption Level")   recast(line) recastci(rline) ///
		 addplot(histogram v2x_corr if e(sample),   yaxis(2) yscale(alt axis(2)) lpattern(dash) ///
		 ytitle("", axis(2)) xtitle("Corruption Level") lwidth(vthin) fcolor(none) lcolor(black) )
	
	 graph save figure_a4

	 
	 
**For review note only	 
*interacting  ODA with internal armed conflicts
*Table R1
xtscc f.dge_p  c.odagdp c.v2x_corr ln_ucdp_type3 $control i.year if recipient_ever==1  , fe lag(1)
 outreg using table_r1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   replace 
xtscc f.dge_p  c.odagdp##c.v2x_corr ln_ucdp_type3 $control i.year if recipient_ever==1  , fe lag(1)
 outreg using table_r1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 
xtscc f.dge_p  c.odagdp##c.ln_ucdp_type3 $control i.year if recipient_ever==1  , fe lag(1)
 outreg using table_r1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 
xtabond2 dge_p L.dge_p c.odagdp##c.ln_ucdp_type3 c.v2x_corr $control i.ccode i.year if recipient_ever ==1 , gmm (l.(dge_p c.odagdp c.v2x_corr ln_ucdp_type3 $control ), lag(3 6))    twostep   noconstant 
 outreg using table_r1.doc, se bdec(3)starlevels(10 5 1) starloc(1)   merge 

 *Table R2
margins, dydx(odagdp) at(ln_ucdp_type3 =(0 (.5) 2))
